import re

# 1.匹配手机号码：
# 13012345678, 131xxxxxxxx,132xxxxxxxx,133xxxxxxxx,134xxxxxxxx,135xxxxxxxx,136xxxxxxxx,137xxxxxxxx,138,139
# 第一位：1，第二位：34578，第三位：0-9   11位。


# pattern = '1[34578]\d\d\d\d.....'

# pattern = '1[34578][0-9]{9}'
pattern = '1[34578]\d{9}$'
string = '1762315698466699'
res = re.search(pattern, string)
print(res.group())

# 2.验证QQ号：第一位非0，长度：5位-11位。
# 441883704

# pattern = '[1-9]\d{4,10}'
# string = '2536545'
# res = re.match(pattern, string)
# print(res.group())

# str1 = 'htps://wwu.com'
str1 = '妮妮哈哈哈哈哈哈啊啊啊啊'
# p = r'(.+?)\1(.+?)\2'
p = r'(.)\1+(.)\2+'
# p = r'[a-zA-z]+://[^\s]*'
res = re.match(p, str1)
print(res.group())
print(res.groups())


